#!/bin/sh

PACKAGE=com/googlecode/phpunit4eclipse/j2phpunit/test
NAME=PHPUnitLauncher
OUT=target/dist/$NAME
REV=`git svn info | grep Revision | perl -pe 's/Revision: (.*)/$1/'`

echo Creating package for version $REV

mvn clean install dependency:copy-dependencies

mkdir -p $OUT
mkdir -p $OUT/lib
mkdir -p $OUT/src/$PACKAGE

cp src/main/eclipse/classpath $OUT/.classpath
cp src/main/eclipse/project $OUT/.project
cp src/main/eclipse/readme.txt $OUT/
cp target/dependency/* target/*.jar $OUT/lib
cp src/main/java/$PACKAGE/PHPTest.java $OUT/src/$PACKAGE
cd $OUT
cd ..
zip -r $NAME-$REV.zip $NAME
rm -rf $NAME
